package com.auto1;

import com.auto2.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args){
//        ApplicationContext context = new ClassPathXmlApplicationContext("auto1.xml");
//        People zs = context.getBean("zs",People.class);
//        System.out.println(zs);
//        System.out.println("姓名：" + zs.getName());
//        System.out.println("手机：" + zs.getPhone().getBrand());
//        System.out.println("电脑：" + zs.getPc().getBrand());

//        ApplicationContext context = new ClassPathXmlApplicationContext("auto2.xml");
//        UserController userController = context.getBean("userController",UserController.class);
//        userController.search();

        ApplicationContext context = new ClassPathXmlApplicationContext("auto2.xml");
        UserController userController = context.getBean("userController",UserController.class);
        userController.search();
    }
}
